package com.wanhe.base.util;

import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Map;

/**
 * Created by Chendj on 2015/8/17.
 */
public class ObjectUtil {

    public static boolean checkRefrece(WeakReference reference) {
        if (reference.get() != null) {
            return true;
        }
        return false;
    }

    public static boolean checkObject(Object object) {
        if (object != null) {
            return true;
        }
        return false;
    }

    public static boolean checkObjectList(List list) {
        if (list != null && !list.isEmpty() && list.size() > 0) {
            return true;
        }
        return false;
    }

    public static boolean checkMap(Map map) {
        if (map != null && !map.isEmpty() && map.size() > 0) {
            return true;
        }
        return false;
    }

    public static boolean checkObjectMap(Map map) {
        return checkMap(map);
    }

    public static boolean isNull(Object object) {
        if (object == null) {
            return true;
        }
        return false;
    }

}
